import pymysql

# 1.连接MySQL
conn=pymysql.connect(host="127.0.0.1",port=3306,user="root",password="yafeilu",charset="utf8",db="unicom")
cursor=conn.cursor(cursor=pymysql.cursors.DictCursor)

# 2.发送指令
sql= "delete from admin where username=%s or password=%s"
cursor.execute(sql,["鲁亚飞","-9"])
conn.commit()

# 3.关闭连接
cursor.close()
conn.close()